import { IMessageBase } from "../../Framework/MQ/IMessageBase";
import { MessageManager } from "../../Framework/MQ/MessageManager";
import { SerializeStream } from "../../Framework/Serialize/SerializeStream";
import { SeqSWaitingPlayerHelper } from "./SeqSWaitingPlayerHelper";
import { SEntityId } from "./SEntityId";
type int = number;
//class SGroup
    
    export  class SGroup extends IMessageBase
    {
        constructor(arg1: Boolean=false)
        {
            
            super();if (arg1) 
            {
                MessageManager.instance().regist(this);
            }
            return;
        }

        public /* override */ getType(): int
        {
            return this._type;
        }

        public /* override */ clone(): IMessageBase
        {
            return new SGroup();
        }

        public /* override */ __write(arg1: SerializeStream): void
        {
            this.groupId.__write(arg1);
            this.captainId.__write(arg1);
            arg1.writeString(this.name);
            arg1.writeString(this.pwd);
            arg1.writeInt(this.allocation);
            arg1.writeInt(this.warfare);
            arg1.writeShort(this.career);
            arg1.writeBool(this.joinInFighting);
            arg1.writeBool(this.fighting);
            arg1.writeByte(this.playerCount);
            arg1.writeByte(this.maxPlayer);
            arg1.writeByte(this.level);
            arg1.writeInt(this.copyCode);
            arg1.writeBool(this.memberInvite);
            SeqSWaitingPlayerHelper.write(arg1, this.players);
            return;
        }

        public /* override */ __read(arg1: SerializeStream): void
        {
            this.groupId = new SEntityId();
            this.groupId.__read(arg1);
            this.captainId = new SEntityId();
            this.captainId.__read(arg1);
            this.name = arg1.readString();
            this.pwd = arg1.readString();
            this.allocation = arg1.readInt();
            this.warfare = arg1.readInt();
            this.career = arg1.readShort();
            this.joinInFighting = arg1.readBool();
            this.fighting = arg1.readBool();
            this.playerCount = arg1.readByte();
            this.maxPlayer = arg1.readByte();
            this.level = arg1.readByte();
            this.copyCode = arg1.readInt();
            this.memberInvite = arg1.readBool();
            this.players = SeqSWaitingPlayerHelper.read(arg1);
            return;
        }

        public /* const */_type: int=20403;

        public /* var */groupId: SEntityId;

        public /* var */captainId: SEntityId;

        public /* var */name: string;

        public /* var */pwd: string;

        public /* var */allocation: int;

        public /* var */warfare: int;

        public /* var */career: int;

        public /* var */joinInFighting: Boolean;

        public /* var */fighting: Boolean;

        public /* var */playerCount: int;

        public /* var */maxPlayer: int;

        public /* var */level: int;

        public /* var */copyCode: int;

        public /* var */memberInvite: Boolean;

        public /* var */players: Array<any>;

        public static /* var */_regist: SGroup;
    }

            SGroup._regist = new SGroup(true);
        